package com.imedical.entity;

import javax.validation.constraints.NotBlank;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2022/5/12
 */
@Data
public class RequestDetail {
    public static final String RESPONSE_TYPE_DATA = "DATA";
    public static final String RESPONSE_TYPE_HTML = "HTML";
    public static final String RESPONSE_TYPE_PDF = "PDF";

    /**
     * HTTP,FTP,WebService
     */
    @NotBlank(message = "不能为空")
    @ApiModelProperty(value = "请求类型(HTTP,FTP,WebService)", allowableValues = ",HTTP,FTP,WebService", required = true)
    private String requestType;

    /**
     * url
     */
    @NotBlank(message = "不能为空")
    @ApiModelProperty(value = "url", required = true)
    private String url;

    /**
     * GET,POST,DELETE,PUT
     */
    @ApiModelProperty(value = "请求方式", allowableValues = "GET,POST,DELETE,PUT")
    private String requestMethod;

    /**
     * 是否异步
     */
    @ApiModelProperty(value = "是否异步", allowableValues = "true,false")
    private Boolean async = false;

    /**
     * Authorization请求头
     */
    @ApiModelProperty(value = "Authorization请求头")
    private String authHeader;

    /**
     * 超时时间(默认30秒),单位s
     */
    @ApiModelProperty(value = "超时时间(默认30秒),单位s")
    private Integer timeout;

    /**
     * FORM,BODY
     */
    @ApiModelProperty(value = "参数传输类型", allowableValues = "FORM,BODY")
    private String paramType;

    /**
     * DATA,HTML,PDF
     */
    @ApiModelProperty(value = "返回数据类型,默认为DATA", allowableValues = "DATA,HTML,PDF")
    private String responseType = RESPONSE_TYPE_DATA;

    /**
     * data_sensitive
     */
    @ApiModelProperty(value = "是否需要隐私化", allowableValues = "true,false")
    private Boolean sensitive = false;

    /**
     * PDF,HTML,PNG
     */
    @ApiModelProperty(value = "报告展示方式", allowableValues = "PDF,HTML,PNG")
    private String displayMode;

    /**
     * 参数(JSON字符串)
     */
    @ApiModelProperty(value = "参数(JSON字符串)", hidden = true)
    private String param;

}
